package com.app.miwawa.api.eam.entity;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.framework.common.api.entity.CommonEntityUUID;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 班级信息表
 * <p>描述: 教务管理</p>
 * <p>Company: Professional</p>
 * @author chanlong(陈龙)
 * @date 2016年2月2日 下午9:16:54
 * @version 1.0.2016
 */
@Entity @Table(name = "TB_EAM_CLASSES_INFO")
public class Classes extends CommonEntityUUID {

	/** serialVersionUID(long):. */
	private static final long serialVersionUID = 8001197825184047077L;

	// 班级类型（早教、托班）
	@Column(name = "type", length = 10, nullable = true)
	private String type;
		
	// 班级编号
	@Column(name = "code", length = 50, nullable = true)
	private String code;
	
	// 班级名称
	@Column(name = "name", length = 50, nullable = true)
	private String name;
	
	// 学员上限
	@Column(name = "toplimit", length = 5, nullable = true)
	private String toplimit;
	
	// 试听上限
	@Column(name = "trylimit", length = 5, nullable = true)
	private String trylimit;
	
	// 耗客数
	@Column(name = "usecount", nullable = true)
	private	Float usecount;
	
	// 开班时间
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Column(name = "create_date", nullable = true)
	private Date createDate;
	
	// 闭班时间
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Column(name = "finish_date", nullable = true)
	private Date finishDate;
	
	@Transient
	private List<ClassesTime> times;
	
	@Transient
	private List<ClassesRelation> relations;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getToplimit() {
		return toplimit;
	}

	public void setToplimit(String toplimit) {
		this.toplimit = toplimit;
	}

	public String getTrylimit() {
		return trylimit;
	}

	public void setTrylimit(String trylimit) {
		this.trylimit = trylimit;
	}

	public Float getUsecount() {
		return usecount;
	}

	public void setUsecount(Float usecount) {
		this.usecount = usecount;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public Date getFinishDate() {
		return finishDate;
	}

	public void setFinishDate(Date finishDate) {
		this.finishDate = finishDate;
	}

	public List<ClassesTime> getTimes() {
		return times;
	}

	public void setTimes(List<ClassesTime> times) {
		this.times = times;
	}

	public List<ClassesRelation> getRelations() {
		return relations;
	}

	public void setRelations(List<ClassesRelation> relations) {
		this.relations = relations;
	}

}
